import { createRouter, createWebHashHistory } from "vue-router";
import Mine from "../views/page/MineView.vue";
import Login from "../views/page/LoginView.vue";
import Index from "../views/page/IndexView.vue";
import Announcement from "../views/page/AnnouncementView.vue";
// import Msg from "../views/page/MessageBoards.vue";
import Course from "../views/page/CourseView.vue";
import Homework from "../views/page/HomeworkView.vue";
import Member from "../views/page/MemberView.vue";
import Test from "../views/page/PostingView.vue";

export const constantRoutes = [
  {
    path: "/",
    name: "root",
    component: Index,
  },
  {
    path: "/login",
    name: "login",
    component: Login,
  },
  {
    path: "/mine",
    name: "mine",
    component: Mine,
  },

  {
    path: "/index",
    name: "index",
    component: Index,
    children: [
      {
        path: "announcement",
        name: "gn1",
        component: Announcement,
      },
      // {
      //   path: "messageBoards",
      //   name: "gn2",
      //   component: Msg,
      // },
      {
        path: "course",
        name: "gn3",
        component: Course,
      },
      {
        path: "homework",
        name: "gn4",
        component: Homework,
      },
      {
        path: "member",
        name: "gn5",
        component: Member,
      },
    ],
  },

  {
    path: "/ok",
    name: "ok",
    component: Test,
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes,
});

export default router;
